package com.ifonly.mvc;

import com.ifonly.interceptor.Interceptor;

import java.lang.reflect.Method;

/**
 * @author <a href="mailto:ifonlymaster@163.com">ifonly</a>
 * @version 1.0 2015-12-09 14:46
 * @since JDK 1.6
 */
class Action {

    private String actionUrl;
    private String viewDir;
    private String controllerClassName;
    private Class<? extends Controller> controllerClass;
    private String methodName;
    private Method method;
    private Interceptor[] interceptors;

    public Action(String actionUrl,
                  Class<? extends Controller> controllerClass,
                  Method method,
                  Interceptor[] interceptors) {
        this.actionUrl = actionUrl;
        this.controllerClass = controllerClass;
        this.method = method;
        this.interceptors = interceptors;
    }

    public Action(String actionUrl, String viewDir,
                  String controllerClassName,
                  Class<? extends Controller> controllerClass,
                  String methodName,
                  Method method,
                  Interceptor[] interceptors) {
        this.actionUrl = actionUrl;
        this.viewDir = viewDir;
        this.controllerClassName = controllerClassName;
        this.controllerClass = controllerClass;
        this.methodName = methodName;
        this.method = method;
        this.interceptors = interceptors;
    }

    public String getActionUrl() {
        return actionUrl;
    }

    public String getViewDir() {
        return viewDir;
    }

    public String getControllerClassName() {
        return controllerClassName;
    }

    public Class<? extends Controller> getControllerClass() {
        return controllerClass;
    }

    public String getMethodName() {
        return methodName;
    }

    public Method getMethod() {
        return method;
    }

    public Interceptor[] getInterceptors() {
        return interceptors;
    }
}
